var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(mode, type, selection) {
    var reactor = "action" + (cm.getMapId() - 993173200);
    eval(reactor)(mode, type, selection)
}

function action0(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.getPlayer().scheduleWarpTask(30 * 60 * 1000, 993173350, 0, false);
            cm.honorEventUIUpdate(8, 2, 1800000, 0, 1800000, 100339);
            cm.getWeatherEffectNotice("你需要消灭翼人军和怪物海鸥，保卫城墙！", 297, 10000, 1);
            cm.dispose()
        }
    }
}

function action50(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.getPlayer().scheduleWarpTask(30 * 60 * 1000, 993173350, 0, false);
            cm.honorEventUIUpdate(8, 2, 1800000, 0, 1800000, 100339);
            cm.getWeatherEffectNotice("你需要消灭翼人军，收集能量激活保护罩！", 297, 10000, 1);
            cm.setNumberForQuestInfo(100336, "energy", 0);
            cm.cerniumLightningDefenseReactorEnergy(eim.getNumberProperty("energy"));
            cm.cerniumLightningDefenseStart();
            cm.dispose()
        }
    }
}

function action100(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.getPlayer().scheduleWarpTask(30 * 60 * 1000, 993173350, 0, false);
            cm.honorEventUIUpdate(8, 2, 1800000, 0, 1800000, 100339);
            cm.getWeatherEffectNotice("你需要消灭翼人军，收集炸弹阻挡空中飞来的魔法炸弹。", 297, 10000, 1);
            cm.setNumberForQuestInfo(100336, "bomb", 0);
            cm.eventSKill(20, 20, 0, 1, 0, 80002822, 1, 0, 0, 0, 0, 0, 0, 1);
            cm.getClockCernium(0, eim.getNumberProperty("endTime") + 60 * 1000 - new Date().getTime(), 60 * 1000);
            cm.dispose()
        }
    }
};